<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container{
            overflow: hidden;
        }

        /* 
            默认情况下d1和body会发生外边距合并
        */
        .d1{
            height: 20px;
            background: green;
            margin: 30px 0;
        }

        .d2{
            height: 20px;
            background: blue;
            margin: 50px 0;
        }

        .wrapper{
            overflow: hidden;
        }
    </style>
</head>
<body>
    <!-- 特性1：bfc是一个独立容器，容器里面的子元素不会影响外面元素 -->
    <div class="container">
        <div class="d1"></div>
        <div class="wrapper">
            <div class="d2"></div>
        </div>
    </div>
</body>
</html>